import 'package:aone_common/router/routes.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:prototype/components/v_navigation_bar/v_navigation_bar.dart';
import 'package:prototype/views/activity/activity_view.dart';
import 'package:prototype/views/home/home_view.dart';
import 'package:prototype/views/user/user_view.dart';

import 'main_controller.dart';

class MainPageView extends StatelessWidget {

  const MainPageView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final controller = Get.put<MainController>(MainController());
    return Scaffold(
      key: controller.scaffoldKey,
      drawer: Drawer(
        child: SafeArea(
          child: SingleChildScrollView(
            child: Column(
              children: [
                MaterialButton(
                  onPressed: () => Get.toNamed(Routes.gameInit),
                  child: const Text('to game init'),
                )
              ],
            ),
          ),
        ),
      ),
      body: Navigator(
        key: Get.nestedKey(1),
        initialRoute: Routes.home,
        onGenerateRoute: controller.onGenerateRoute,
      ),
      bottomNavigationBar: const VNavigationBar(),
    );
  }
}
